<?php include "classes.inc" ?>
<?php include "constants.inc" ?>
<?php if (!session_id()) session_start(); ?> 
<?php
    $content = trim($_POST['jeugdContent']);
    
    if ( !empty($content) ) {

        $connect = mysql_connect(DB_SERVER, DB_USER, DB_PWD);
        mysql_select_db(DB_CATALOG);
        $result = mysql_query("SET AUTOCOMMIT=0", $connect);
        $result = mysql_query("BEGIN", $connect);

        $query = sprintf("UPDATE jeugd SET content='%s'",
            mysql_real_escape_string(utf8_decode($content)));
            
        $result = mysql_query($query, $connect);

        $result = mysql_query("COMMIT", $connect);
        
    } else {
        echo "Tekst is verplicht veld.";
    }
?>
